<?php
$this->Html->addCrumb('Brags');
?>
<h1 class="pageTitle">Brags</h1>
<?php
  if(isset($brags) && !empty($brags)) {
    foreach ($brags as $brag) {
      echo '<h2>'.$brag['Brag']['title'].'</h2>';
      if (!empty($brag['Brag']['image_path'])) {
        echo '<img src="'.Configure::read('App.pathPrefix').'/'.IMAGES_URL.$brag['Brag']['image_path'].'"  alt="'.$brag['Brag']['title'].'" />';
      }
      echo '<p>'.nl2br($brag['Brag']['content']).'</p>';
      echo '<hr class="brag"/>';
    }
    echo $this->element('main_pagination');
  } else {
    echo '<p>No brags are currently available</p>';
  }
?>